﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DatabaseToCode.Schema
{
    public enum ForeignKeyType { 
        Undeterminate,
        OneToZeroOne,
        OneToOne,
        OneToMany,
        ManyToMany
    }

    public class ForeignKey
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ForeignKey"/> class.
        /// </summary>
        public ForeignKey() {
            this.ForeignKeyType = DatabaseToCode.Schema.ForeignKeyType.Undeterminate;
        }

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the table.
        /// </summary>
        /// <value>
        /// The table.
        /// </value>
        public string Table { get; set; }

        /// <summary>
        /// Gets or sets the column.
        /// </summary>
        /// <value>
        /// The column.
        /// </value>
        public string Column { get; set; }

        /// <summary>
        /// Gets or sets the constraint table.
        /// </summary>
        /// <value>
        /// The constraint table.
        /// </value>
        public string ConstraintTable { get; set; }

        /// <summary>
        /// Gets or sets the constraint column.
        /// </summary>
        /// <value>
        /// The constraint column.
        /// </value>
        public string ConstraintColumn { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [will cascade on delete].
        /// </summary>
        /// <value>
        /// 	<c>true</c> if [will cascade on delete]; otherwise, <c>false</c>.
        /// </value>
        public bool WillCascadeOnDelete { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance has optional.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance has optional; otherwise, <c>false</c>.
        /// </value>
        public bool HasOptional { get; set; }

        /// <summary>
        /// Gets or sets the type of the foreign key.
        /// </summary>
        /// <value>
        /// The type of the foreign key.
        /// </value>
        public ForeignKeyType ForeignKeyType { get; set; }
    }
}
